﻿using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Markup;
using Microsoft.Win32;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace HearthHelper
{
	public class AccountCheckedItem : INotifyPropertyChanged
	{
		private bool selected;
		private string email;
		private string emailShow;
		private bool running;
		private string deck;
		private int rule;
		private int behavior;
		private int startTime;
		private int endTime;
		private int stonePid;

		public AccountCheckedItem(bool isSelected, string whichEmail)
		{
			selected = isSelected;
			email = whichEmail;
			emailShow = HideUtil.ReplaceWithSpecialChar(whichEmail);
			running = false;
			deck = "请在中控配置账号";
			rule = 2;//经典
			behavior = 11;//防战
			startTime = 0;
			endTime = 24;
			stonePid = 0;
		}

		public event PropertyChangedEventHandler PropertyChanged;
		protected void OnPropertyChanged(string propertyName)
		{
			if (PropertyChanged != null)
			{
				PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}

		public bool Running
		{
			get{return running;}
			set{running = value;OnPropertyChanged("Running"); }
		}

		public int Behavior
		{
			get{return behavior;}
			set{behavior = value;OnPropertyChanged("Behaviour");}
		}

		public string Deck
		{
			get{return deck;}
			set{deck = value;OnPropertyChanged("Deck");}
		}

		public int Rule
		{
			get{return rule;}
			set{rule = value;OnPropertyChanged("Rule");}
		}

		public bool Selected
		{
			get{return selected;}
			set{selected = value;OnPropertyChanged("Selected");}
		}

		public string Email
		{
			get{return email;}
			set{email = value;OnPropertyChanged("Email");
				EmailShow = HideUtil.ReplaceWithSpecialChar(value);}
		}

		public string EmailShow
		{
			get{return emailShow;}
			set{emailShow = value;OnPropertyChanged("EmailShow");}
		}

		public int StartTime
		{
			get{return startTime;}
			set
			{
				startTime=(value>=0&&value<=24)?value:0;
				OnPropertyChanged("StartTime");
			}
		}

		public int EndTime
		{
			get{return endTime;}
			set
			{
				endTime=(value>=0&&value<=24)?value:0;
				OnPropertyChanged("EndTime");
			}
		}

		public int StonePid
		{
			get{return stonePid;}
			set{stonePid = value;OnPropertyChanged("StonePid");}
		}
	}
}

